// Author: wsfuyibing <682805@qq.com>
// Date: 2025-06-23

package kind

import "fmt"

// OrderOperation
// 订单操作类型.
type OrderOperation int

const (
	_ OrderOperation = iota

	OrderOperationCreate
	OrderOperationClosed
)

var (
	orderOperationTexts = map[OrderOperation]string{
		OrderOperationCreate: "创建订单",
		OrderOperationClosed: "关闭订单",
	}
)

func (o OrderOperation) Text() string {
	if str, ok := orderOperationTexts[o]; ok {
		return str
	}
	return ""
}

func (o OrderOperation) ToMessage() (str string) {
	switch o {
	default:
		str = ""
	}
	return
}

func (o OrderOperation) ToOrderOperationCreate(on OrderNo, amount Balance) string {
	return fmt.Sprintf(`创建单号为 %s 的订单, 总价 %.02f 元`, on, amount)
}
